#include <iostream>
#include "Exception.h"

using namespace std;
using namespace StructLib;

#define TestModel(x) \
    if (x)           \
    {
#define END }

enum TestModels
{
    ExceptionTest = true,
};

void FunTest()
{
    try
    {
       // throw Exception("test", __FILE__, __LINE__);
       //THROW_EXCEPTION(Exception, "test");
       THROW_EXCEPTION(ArithmeticException, "test");
    }
    catch (const ArithmeticException &e)
    {
        cout << "catch(const ArithmeticException& e)" << endl;
        cout << e.message() << endl;
        cout << e.location() << endl;
    }
    catch (const Exception &e)
    {
        cout << "catch(const Exception& e)" << endl;
        cout << e.message() << endl;
        cout << e.location() << endl;
    }

}

int main()
{
    TestModel(ExceptionTest)
        FunTest();
    END

    std::cout << "this main()" << std::endl;
    return 0;
}
